package com.hqq.pack5;
/**
 * 学习最终通知通知
 */


import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.AfterThrowing;
import org.aspectj.lang.annotation.Aspect;

@Aspect
public class MyAspect {


    @AfterThrowing(value = "execution(* *..SomeServiceImpl.doAfter(..))",throwing = "e")
    public void myAfterThrowing(Exception e){

        System.out.println("异常通知有fnally"+e.getMessage());
        //异常通知/ by zero

    }

    @After(value = "execution(* *..SomeServiceImpl.doAfter(..))")
    public void myAfterThrowing(){

        System.out.println("执行最终通知 相当于finally");
        //异常通知/ by zero

    }


}
